<?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  Released under the GNU General Public License
*/

  require('includes/application_top.php');
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEWSCENTER);

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_NEWSCENTER));
  
  require(DIR_WS_INCLUDES . 'template_top.php');

  $news_detail = false;
  if(isset($HTTP_GET_VARS['news_id']) && tep_not_null($HTTP_GET_VARS['news_id'])) {
	$newscenter_id = tep_db_prepare_input($HTTP_GET_VARS['news_id']);
	
	$newscenter_query = tep_db_query("select newscenter_title, newscenter_description from " . TABLE_NEWSCENTER_DESCRIPTION . " where newscenter_id = '" . (int)$newscenter_id . "' and language_id = '" . (int)$languages_id . "'");
	if(tep_db_num_rows($newscenter_query) > 0) {
	  $news_detail = true;
	  $newscenter = tep_db_fetch_array($newscenter_query);
	}
  }
  
  if(!$news_detail) {
	$newscenter_sql = "select nd.newscenter_id, nd.newscenter_title, nd.newscenter_description, ni.image from " . TABLE_NEWSCENTER . " n inner join " . TABLE_NEWSCENTER_DESCRIPTION . " nd on (n.newscenter_id = nd.newscenter_id) left join " . TABLE_NEWSCENTER_IMAGES . " ni on (n.default_image_id = ni.id) where nd.language_id = '" . (int)$languages_id . "' order by n.newscenter_id desc";
	$newscenter_split = new splitPageResults($newscenter_sql, MAX_DISPLAY_SEARCH_RESULTS, 'n.newscenter_id');
  }

?>

<div id="left">
    <div class="CategoryView">
<?php
if(!$news_detail) {
?>
    <h1 class="left_title"><?php echo HEADING_TITLE; ?></h1>
        <div class="SpecialViewContent">
<?php
  if ($newscenter_split->number_of_rows > 0) {
?>
            <ul class="menuNews">
<?php
	$newscenter_query = tep_db_query($newscenter_split->sql_query);
	while($news = tep_db_fetch_array($newscenter_query)) {
?>
                <li class="article_row">           
                    <?php if(tep_not_null($news['image'])) echo '<img src="' . DIR_WS_IMAGES . 'newscenter/' . $news['image'] . '" class="thumb" alt="">'; ?>
                    <a href="<?php echo tep_href_link(FILENAME_NEWSCENTER, 'news_id=' . $news['newscenter_id']); ?>"><?php echo $news['newscenter_title']; ?></a> 
                    <p class="desc"><?php echo tep_get_short_name(strip_tags($news['newscenter_description']), 290); ?></p>
                </li>
<?php
	}
?>
            </ul>
<?php
  } else {
	  echo '<p style="color:#FFF">' . TEXT_NO_NEWS . '</p>';
  }

  if ( ($newscenter_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
    <div class="Pav" align="center"><?php echo $newscenter_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>
<?php
  }
?>
        </div>
<?php
} else {
?>
	<h1 class="left_title"><?php echo $newscenter['newscenter_title']; ?></h1>
    <p><?php echo $newscenter['newscenter_description']; ?></p>
<?php
}
?>
    </div>
</div><!--end #left -->

<div id="right">

	<div style="width:250px; overflow:hidden; float:right;">

    <div class="moduletable_nhanbaiviet">

        <h3>NIEUWSBRIEVEN</h3>

        <div class="acymailing_module_nhanbaiviet" id="acymailing_module_formAcymailing1">

            <div class="acymailing_fulldiv" id="acymailing_fulldiv_formAcymailing1">

            <form id="formAcymailing1" onsubmit="return false">

            <p class="title_acy">Wilt u op de hoogte gehouden worden over onze nieuwe artikels?</p>

            <div class="acymailing_module_form">

            <table class="acymailing_form">

            <tbody><tr>

            <td class="acyfield_email">

            <input id="user_email_formAcymailing1" onfocus="if(this.value == 'Email...') this.value = '';" onblur="if(this.value=='') this.value='Email...';" class="inputbox"size="15" value="Email..." type="text">

            </td> </tr><tr>                    <td class="acysubbuttons">

            <input class="button subbutton" value="Registreren" name="Submit" onclick="return add_email_newsletter();" type="button">

            </td>

            </tr>

            </tbody></table>

            </div>

            </form>

            </div>

        </div>		

    </div>

    <div class="moduletable_archief">

        <h3>Archief</h3>

        <span>Informatie archief mei 2011<br /> &nbsp;&nbsp;&nbsp;juli (14)</span>

        <ul class="archief">

            <li><a href="#">DE WINKEL</a></li>

            <li><a href="#">BLANKENBERGE</a></li>

            <li><a href="#">NU OOK VERKOOP IN GROOTHANDEL</a></li>

            <li><a href="#">IN BLANKENBERGE TOT SEPTEMBER</a></li>

            <li><a href="#">COPYRIGHT</a></li>

            <li><a href="#">Verkoopsvoorwaarden</a></li>

            <li><a href="#">Veel gestelde vragen</a></li>

            <li><a href="#">Disclaimer</a></li>

            <li><a href="#">Eerlijke handel</a></li>

            <li><a href="#">Rechtsreekse import</a></li>

            <li><a href="#">Speciaal zaak ethnic kleddij, decoratie en juwelen</a></li>

            <li><a href="#">Historiek</a></li>

            <li><a href="#">ARTIKELS 2</a></li>

        </ul>

    </div>

    <div class="moduletable_media">

        <h3>Kathmandu in de media</h3>

        <div style="text-align: left;">De Streekkrant 27 april 2011</div>		

    </div>

    </div>

</div>



<?php

  require(DIR_WS_INCLUDES . 'template_bottom.php');

  require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

